[FEAT] Backend: Implement Soroban Event Indexer #200#206
Merged
ogazboiz merged 2 commits intoLabsCrypt:mainfrom Feb 26, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implement a Soroban polling indexer service in the backend to sync stream lifecycle events into Postgres for fast dashboard reads.
Closes #200
Changes proposed
What were you told to do?
I was asked to:
StreamCreatedEventinto database records,StreamCancelledEventandTokensWithdrawnEvent.What did I do?
Added Soroban event polling indexer service
Created
backend/src/services/soroban-indexer.service.ts:getEventson interval,STREAM_CONTRACT_ID),Stream + event database synchronization logic
Implemented handlers for:
stream_created-> upsert users and create/updateStreamrow,stream_cancelled-> markStream.isActive = false,tokens_withdrawn-> incrementwithdrawnAmountand update active status.All indexed events are persisted to
StreamEvent, with duplicate guard by(streamId, eventType, transactionHash, ledgerSequence)lookup.Startup wiring
Updated
backend/src/index.tsto start the indexer after DB connection succeeds.Check List (Check all the applicable boxes)
Screenshots / Testing Evidence
Attempted validation:
Build fails on pre-existing backend TypeScript issues unrelated to this PR (existing type/config errors in multiple backend files).